ot, zk = '([[{<', '>}])'
checkot, checkzk = 0, 0
stack = []
sequence = input()
for i in sequence:
    stack.append(sequence)
    if i in ot:
        checkot += 1
    else:
        checkzk += 1
checker = True
if(checkot != checkzk):
    print('False')
else:
    for char in sequence:
        if char in ['(', '[', '{', '<']:
            stack.append(char)
        elif char in [')', ']', '}', '>']:
            if not stack:
                checker = False
            if char == ')' and stack[-1] == '(':
                stack.pop()
            elif char == ']' and stack[-1] == '[':
                stack.pop()
            elif char == '}' and stack[-1] == '{':
                stack.pop()
            else:
                checker = False
print('yes' if checker else 'no')